package cn.itcast.export.service.impl;

import cn.itcast.export.dao.ExportDao;
import cn.itcast.export.dao.ExportProductDao;
import cn.itcast.export.domain.ExportProduct;
import cn.itcast.export.domain.ExportProductExample;
import cn.itcast.export.service.ExportProductService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class ExportProductServiceImpl implements ExportProductService {

	@Autowired
	private ExportProductDao exportProductDao;

	@Override
	public void save(ExportProduct ep) {
		ep.setEpId(UUID.randomUUID().toString());
		exportProductDao.insert(ep);
	}

	@Override
	public ExportProduct findById(String id) {
		return exportProductDao.selectByPrimaryKey(id);
	}

	@Override
	public void update(ExportProduct ep) {
		exportProductDao.updateByPrimaryKey(ep);
	}

	@Override
	public List findAll(ExportProductExample example) {
		return exportProductDao.selectByExample(example);
	}
}
